/**
 * 
 */
package leetCode;

import java.util.HashSet;

/**
 * @author zhongfang
 *
 */
public class DistributeCandies {
    public int distributeCandies(int[] candies) {
        HashSet<Integer> set=new HashSet<>(candies.length);
        for (int integer : candies) {
			set.add(integer);
		}
        return Math.min(set.size(), candies.length/2);
    }
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		int[] c={1,1,1,3};
		System.out.println(new DistributeCandies().distributeCandies(c));
	}

}
